package com.icinfo.cloud.provider.punish.fastcase.controller;

import com.icinfo.cloud.provider.punish.common.documentdataload.dto.CaseDataQueryDto;
import com.icinfo.cloud.provider.punish.service.ICloseArchivingService;
import com.icinfo.cloud.provider.punish.ucase.casemain.vo.CaseMainDetailInfoCommonVo;
import com.icinfo.cloud.provider.punish.ucase.closearchiving.dto.CaseCloseArchivingDto;
import com.icinfo.cloud.provider.punish.ucase.closearchiving.vo.CaseCloseArchivingEchoVo;
import com.icinfo.framework.common.web.Result;
import com.icinfo.framework.core.web.BaseController;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 结案归档 controller
 *
 * @author chenhan
 */
@RestController
@RequestMapping("/close")
@Slf4j
public class CloseArchivingController extends BaseController {

    @Resource
    private ICloseArchivingService ICloseArchivingService;

    /**
     * 保存结案归档信息
     *
     * @param caseCloseArchivingDto
     * @return
     * @author 陈汉
     * @date 2022年12月5日16:26:14
     */
    @PostMapping("/closeArchiving")
    public Result<String> closeArchiving(@Validated @RequestBody CaseCloseArchivingDto caseCloseArchivingDto) {
        return ICloseArchivingService.saveCloseInfo(caseCloseArchivingDto);
    }

    /**
     * 结案归档 回显
     *
     * @param caseCloseArchivingDto
     * @return
     * @author 陈汉
     * @date 2022年12月5日16:26:14
     */
    @PostMapping("/closeArchivingEcho")
    public Result<CaseCloseArchivingEchoVo> closeArchivingEcho(@RequestBody CaseCloseArchivingDto caseCloseArchivingDto) {
        return ICloseArchivingService.closeArchivingEcho(caseCloseArchivingDto);
    }

    /**
     * 描述：获取案件基础信息
     *
     * @param queryDto
     * @return
     * @author 陈汉
     * @date 2022年12月5日16:55:46
     */
    @PostMapping("/getCaseMainInfo")
    public Result<CaseMainDetailInfoCommonVo> getCaseMainInfo(@RequestBody @Validated CaseDataQueryDto queryDto) {
        return ICloseArchivingService.getCaseMainInfo(queryDto);
    }


}
